#include "gtkthemingengine.h"
#include "gtktypebuiltins.h"
-typedef gboolean (* GtkStyleParseFunc) (GtkCssParser *parser,
- GFile *base,
- GValue *value);
-typedef void (* GtkStylePrintFunc) (const GValue *value,
- GString *string);
-
static GHashTable *parse_funcs = NULL;
static GHashTable *print_funcs = NULL;
static GHashTable *properties = NULL;
return success;
}
+
+ func = property->parse_func;
}
+ else
+ func = NULL;
- func = g_hash_table_lookup (parse_funcs,
- GSIZE_TO_POINTER (G_VALUE_TYPE (value)));
+ if (func == NULL)
+ func = g_hash_table_lookup (parse_funcs,
+ GSIZE_TO_POINTER (G_VALUE_TYPE (value)));
if (func == NULL)
func = g_hash_table_lookup (parse_funcs,
GSIZE_TO_POINTER (g_type_fundamental (G_VALUE_TYPE (value))));
css_string_funcs_init ();
- func = g_hash_table_lookup (print_funcs,
- GSIZE_TO_POINTER (G_VALUE_TYPE (value)));
+ if (property)
+ func = property->print_func;
+ else
+ func = NULL;
+
+ if (func == NULL)
+ func = g_hash_table_lookup (print_funcs,
+ GSIZE_TO_POINTER (G_VALUE_TYPE (value)));
if (func == NULL)
func = g_hash_table_lookup (print_funcs,
GSIZE_TO_POINTER (g_type_fundamental (G_VALUE_TYPE (value))));
GTK_TYPE_BORDER, 0),
NULL,
unpack_margin,
- pack_margin);
+ pack_margin,
+ NULL,
+ NULL);
gtk_style_properties_register_property (NULL,
g_param_spec_int ("padding-top",
"padding top",
GTK_TYPE_BORDER, 0),
NULL,
unpack_padding,
- pack_padding);
+ pack_padding,
+ NULL,
+ NULL);
gtk_style_properties_register_property (NULL,
g_param_spec_int ("border-top-width",
"border top width",
GTK_TYPE_BORDER, 0),
NULL,
unpack_border_width,
- pack_border_width);
+ pack_border_width,
+ NULL,
+ NULL);
gtk_style_properties_register_property (NULL,
g_param_spec_int ("border-radius",
"Border radius",
_gtk_style_property_register (GParamSpec *pspec,
GtkStylePropertyParser property_parse_func,
GtkStyleUnpackFunc unpack_func,
- GtkStylePackFunc pack_func)
+ GtkStylePackFunc pack_func,
+ GtkStyleParseFunc parse_func,
+ GtkStylePrintFunc print_func)
{
const GtkStyleProperty *existing;
GtkStyleProperty *node;
node->property_parse_func = property_parse_func;
node->pack_func = pack_func;
node->unpack_func = unpack_func;
+ node->parse_func = parse_func;
+ node->print_func = print_func;
g_hash_table_insert (properties, pspec->name, node);
}
typedef void (* GtkStylePackFunc) (GValue *value,
GtkStyleProperties *props,
GtkStateFlags state);
+typedef gboolean (* GtkStyleParseFunc) (GtkCssParser *parser,
+ GFile *base,
+ GValue *value);
+typedef void (* GtkStylePrintFunc) (const GValue *value,
+ GString *string);
+
struct _GtkStyleProperty
{
GtkStylePropertyParser property_parse_func;
GtkStyleUnpackFunc unpack_func;
GtkStylePackFunc pack_func;
+ GtkStyleParseFunc parse_func;
+ GtkStylePrintFunc print_func;
};
const GtkStyleProperty * _gtk_style_property_lookup (const char *name);
void _gtk_style_property_register (GParamSpec *pspec,
GtkStylePropertyParser property_parse_func,
GtkStyleUnpackFunc unpack_func,
- GtkStylePackFunc pack_func);
+ GtkStylePackFunc pack_func,
+ GtkStyleParseFunc parse_func,
+ GtkStylePrintFunc print_func);
gboolean _gtk_style_property_is_shorthand (const GtkStyleProperty *property);
GParameter * _gtk_style_property_unpack (const GtkStyleProperty *property,